from django.db import models

from user.models import UserProfile
from video.models import Videos


class Danmaku(models.Model):
    id = models.BigAutoField(primary_key=True)
    video = models.ForeignKey(Videos, on_delete=models.CASCADE)
    text = models.TextField()
    author = models.ForeignKey(UserProfile, on_delete=models.CASCADE)
    time = models.FloatField(default=0)
    type = models.IntegerField(default=0)
    color = models.CharField(max_length=8,default='FFFFFF') # 颜色转换为10进制
# Create your models here.
